import { sendRequest } from '@/http';

const baseUrl = '/admin/drug';

/* 查询药品列表 */
export const queryDrugList = (params: any) =>
  sendRequest({
    url: `${baseUrl}/queryDrugList`,
    method: 'get',
    params,
  });

/* 查询药品信息详情 */
export const queryDrugInfo = (params: any) =>
  sendRequest({
    url: `${baseUrl}/queryDrugInfo`,
    method: 'get',
    params,
  });

/* 新建药品信息 */
export const createDrug = (data: any) =>
  sendRequest({
    url: `${baseUrl}/createDrug`,
    method: 'post',
    data,
  });

/* 禁用药品 */
export const disableDrug = (data: any) =>
  sendRequest({
    url: `${baseUrl}/disableDrug`,
    method: 'post',
    data,
  });

/* 修改药品信息 */
export const editDrug = (data: any) =>
  sendRequest({
    url: `${baseUrl}/editDrug`,
    method: 'post',
    data,
  });

/* 启用药品 */
export const enableDrug = (data: any) =>
  sendRequest({
    url: `${baseUrl}/enableDrug`,
    method: 'post',
    data,
  });

/* 启用药品 */
export const deleteDrug = (drugId: string) =>
  sendRequest({
    url: `${baseUrl}/deleteDrug`,
    method: 'post',
    data: { drugId },
  });
